package cn.iocoder.yudao.module.biz.dal.mysql.specialWorkType;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.biz.dal.dataobject.specialWorkType.BizSpecialWorkTypeDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.biz.controller.admin.specialWorkType.vo.*;

/**
 * 工种类型 Mapper
 *
 * @author guangpu
 */
@Mapper
public interface BizSpecialWorkTypeMapper extends BaseMapperX<BizSpecialWorkTypeDO> {

    default PageResult<BizSpecialWorkTypeDO> selectPage(BizSpecialWorkTypePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<BizSpecialWorkTypeDO>()
                .likeIfPresent(BizSpecialWorkTypeDO::getName, reqVO.getName())
                .betweenIfPresent(BizSpecialWorkTypeDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime())
                .orderByDesc(BizSpecialWorkTypeDO::getId));
    }

    default List<BizSpecialWorkTypeDO> selectList(BizSpecialWorkTypeExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<BizSpecialWorkTypeDO>()
                .likeIfPresent(BizSpecialWorkTypeDO::getName, reqVO.getName())
                .betweenIfPresent(BizSpecialWorkTypeDO::getCreateTime, reqVO.getBeginCreateTime(), reqVO.getEndCreateTime())
                .orderByDesc(BizSpecialWorkTypeDO::getId));
    }

}
